$(document.body).ready(function(){
          DecoupledEditor
           .create( document.querySelector( '#editor' ),{
             language:'zh-cn',
             toolbarCanCollapse :true,
             baseFloatZIndex:0
           } )
           .then( function(editor) {
               const toolbarContainer = document.querySelector( '#toolbar-container' );
               var items = editor.ui.view.toolbar.items;

               //for(var itemIndex = 0;itemIndex<items.length;itemIndex++){

               //}
               toolbarContainer.appendChild( editor.ui.view.toolbar.element );

           } )
           .catch( function(error) {
               console.log( error );
           } );



$("#noteeditor").on("width-change",function(event){
  console.log($("#toolbar-container").children().eq(0).children().not("a").length);
  console.log($("#toolbar-container").children().eq(0).width());
});
});
